package com.xxx.auth.common.util;

import com.xxx.auth.common.web.exception.UnprocessableEntityException;
import jakarta.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;

public class LoginUserUtil {

    public static String getLoginUserId(HttpServletRequest request) {
        String userId = request.getHeader("User-Id");
        if (StringUtils.isBlank(userId)) {
            throw new UnprocessableEntityException("Header User-Id is required");
        }
        return userId;
    }

}
